local function goBack( uid )
	doTransformItem( uid, 1945 )
	return TRUE
end

function onUse(cid, item, frompos, item2, topos)
	-- Very simple - rest have been done by movement scripts.
	
	local switchPositions = {
		{ x=1379, y=854, z=9 },	
		{ x=1379, y=858, z=9 },
		{ x=1382, y=856, z=9 },
		{ x=1376, y=856, z=9 },
	}

	for key,switchPosition in pairs( switchPositions ) do
		local Switch = getTileItemById( switchPosition, 425 )
		doPlayerSendTextMessage( cid, MESSAGE_INFO_DESCR, Switch )
		if Switch == nil then doPlayerSendCancel( "Sorry, not possible." ); return FALSE; end
	end

	local newPositions = {
		{ x=1374, y=922, z=8 },
		{ x=1374, y=921, z=8 },
		{ x=1375, y=921, z=8 },
		{ x=1375, y=922, z=8 },
	}

	for key,switchPosition in pairs( switchPositions ) do
		local Player = getTopCreature( switchPosition )
		if isPlayer(Player) == TRUE then
			doSendMagicEffect( switchPosition, CONST_ME_TELEPORT )
			doTeleportThing( Player, newPositions[key] )
			doSendMagicEffect( newPositions[key], CONST_ME_TELEPORT )
		end
	end

	doTransformItem( item.uid, 1946 )
	addEvent( goBack, 10000, item.uid )

	return TRUE
end
